<template>
	<view class="content">
		<image class="logo" :src="src"></image>
		<view class="text-area">
			<input type="nickname" @focus="getnickname">
		</view>
		
		<button open-type="chooseAvatar" @chooseavatar="getuserinfo">获取头像</button>
	</view>
</template>

<script setup>
import {ref,onMounted} from 'vue'
const src=ref('/static/logo.png');
const title=ref('hello')

const getuserinfo=(res)=>{
	src.value=res.detail.avatarUrl
}
const getnickname=(res)=>{
	console.log(res,'111111111')
}

onMounted(()=>{
	console.log(1);
	uni.authorize({
		scope:'scope.userLocation',
		success:function(){
			uni.getLocation({
				type: 'wgs84',
				success: function (res) {
					console.log(res)
					console.log('当前位置的经度：' + res.longitude);
					console.log('当前位置的纬度：' + res.latitude);
				}
			});
		}
	})
	
})	

	
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
